package com.example.controller;

import com.example.service.IListOfGoodsService;
import com.example.service.IProductDetailsService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jobob
 * @since 2024-09-05
 */
@RestController
@RequestMapping("/uni-app/product-details")
public class ProductDetailsController {
    @Resource
    IProductDetailsService productDetailsService;

    @Resource
    IListOfGoodsService listOfGoodsService;

    @RequestMapping("/list")
    public ResponseEntity<Map<String, Object>> product(Integer id){
        Map<String,Object> map = new HashMap<>();
        map.put("listOfGoods",listOfGoodsService.listListId(id));
        return ResponseEntity.ok(map);
    }
}
